# import asyncio
# from metagpt.roles import (
#     Architect,
#     Engineer,
#     ProductManager,
#     ProjectManager,
# )
# from metagpt.team import Team
#
#
# async def startup(idea: str):
#     company = Team()
#     company.hire(
#         [
#             ProductManager(),
#             Architect(),
#             ProjectManager(),
#             Engineer(),
#         ]
#     )
#     company.invest(investment=3.0)
#     company.run_project(idea=idea)
#
#     await company.run(n_round=5)
#
# #
# await startup(idea="write a cli blackjack game")  # blackjack: 二十一点
import asyncio

from metagpt.actions import Action
from metagpt.environment import Environment
from metagpt.roles import Role
from metagpt.team import Team

action1 = Action(name="AlexSay", instruction="Express your opinion with emotion and don't repeat it")
action2 = Action(name="BobSay", instruction="Express your opinion with emotion and don't repeat it")
alex = Role(name="Alex", profile="Democratic candidate", goal="Win the election", actions=[action1], watch=[action2])
bob = Role(name="Bob", profile="Republican candidate", goal="Win the election", actions=[action2], watch=[action1])
env = Environment(desc="US election live broadcast")
team = Team(investment=10.0, env=env, roles=[alex, bob])

asyncio.run(team.run(idea="Topic: climate change. Under 80 words per message.", send_to="Alex", n_round=5))